package mapeditor.itemselectpanel;

import java.awt.Dimension;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.Icon;
import javax.swing.JLabel;

public class ImageLabelSideBar extends JLabel implements MouseListener

{
	ItemSelectionPanel	panel;
	private Icon		icon;
	private String		name;

	public ImageLabelSideBar( String name , Icon icon , ItemSelectionPanel panel ) {
		super( name, icon, JLabel.LEFT );
		this.name = name;
		this.icon = icon;
		this.panel = panel;
		setHorizontalTextPosition( JLabel.RIGHT );
		setPreferredSize( new Dimension( 150 , 50 ) );
	}

	@Override
	public void mouseClicked( MouseEvent arg0 )
	{
		panel.labelClicked( this );
	}

	@Override
	public void mouseEntered( MouseEvent arg0 )
	{
		panel.labelHovered( this );
	}

	@Override
	public void mouseExited( MouseEvent arg0 )
	{
		panel.labelHovered( null );
	}

	@Override
	public void mousePressed( MouseEvent arg0 )
	{
	}

	@Override
	public void mouseReleased( MouseEvent arg0 )
	{
	}
}
